package com.jay.net.clazz.socket.udp;

import java.io.IOException;
import java.net.DatagramPacket;

public class ConcurrentUDPServer extends UDPServer {
	public ConcurrentUDPServer(int port) throws IOException {
		super(port);
	}

	public void run() {
		for (;;) {
			try {
				byte[] buffer = new byte[8192];
				DatagramPacket packet = new DatagramPacket(buffer,
						buffer.length);
				socket.receive(packet);
				new Thread(new ConnectionHandler(socket, packet)).start();
			} catch (IOException e) {
				// …
			}
		} // for (;;)
	} // run()
} // class
